﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using BUS;

namespace TemplateH4.Admin
{
    public partial class QLTK : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //UserBUS uBus = new UserBUS();
            //dstk.DataSource = uBus.LayDanhSach();
            //dstk.DataBind();


        }

        protected void dstk_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        protected void LinkButton2_Click(object sender, EventArgs e)
        {
            //GridViewRow row = dstk.SelectedRow;
            //int index = dstk.SelectedIndex;
            //Response.Write(index);

            //find user
            //MembershipUserCollection list = Membership.FindUsersByName(row.Cells[1].Text);
            //MembershipUser[] listUsr = new MembershipUser[1];
            //list.CopyTo(listUsr, 0);
            //MembershipUser usr = listUsr[0];
            //Response.Write(usr.UserName);
            ////Change Pass
            //MembershipUser usr = listUsr[0];
            //usr.ChangePassword("PassCu", "PassMoi");
            ////Delete
            //Membership.DeleteUser("royalnight102");
            ////create user
            //MembershipCreateStatus status = new MembershipCreateStatus();
            //Membership.CreateUser("chicken", "chicken", "chicken@yahoo.com", "GAKON I MISS U!", "SHMILU", true, out status);

            LinkButton btn = (LinkButton)sender;
            Response.Write(btn.CommandArgument);
            
        }

        protected void btnXoaChon_Click(object sender, EventArgs e)
        {
            //List<int> SelectedIndex = new List<int>();
            //foreach (GridViewRow row in dstk.Rows)
            //{
            //    CheckBox cb = (CheckBox)row.FindControl("UserCheck");
            //    if (cb != null && cb.Checked == true)
            //    {
            //        //Membership.DeleteUser(row.Cells[3].Text);
            //    }
            //}
        }

        protected void CheckAllUser_CheckedChanged(object sender, EventArgs e)
        {

            //CheckBox CheckAll = (CheckBox)sender;
            //foreach (GridViewRow row in dstk.Rows)
            //{
            //    CheckBox cb = (CheckBox)row.FindControl("UserCheck");
            //    if (cb != null)
            //        cb.Checked = CheckAll.Checked;
            //}
        }

        protected void btncheckAll_Click(object sender, EventArgs e)
        {
            //String txt = btncheckAll.Text;

            //foreach (GridViewRow row in dstk.Rows)
            //{
            //    CheckBox cb = (CheckBox)row.FindControl("UserCheck");
            //    if (cb != null)
            //    {
            //        if (txt == "Chọn hết")
            //        {
            //            cb.Checked = true;
            //            btncheckAll.Text = "Bỏ chọn hết";
            //        }
            //        else
            //        {
            //            cb.Checked = false;
            //            btncheckAll.Text = "Chọn hết";
            //        }
            //    }
            //}

        }

    }
}
